package com.pzl.controller;

import com.pzl.domain.User;
import com.pzl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * UserController class
 *
 * @Author panzhenglei
 * @Date 2019/6/14 7:19 PM
 */


@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/findAll.do")
    public List<User> findAll() {
        return userService.findAll();
    }

    @RequestMapping("/findById.do")
    public User findByID(Integer id) {
        return userService.findByID(id);
    }

    @RequestMapping("/update.do")
    public void update(@RequestBody User user) {
        userService.update(user);
    }

}
